package cn.edu.hpu.service;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import cn.edu.hpu.dao.MailDao;
import cn.edu.hpu.pojo.Mail;
@Transactional
public class MailService {
	private MailDao mailDao;

	public void save(Mail mail){
		mailDao.save(mail);
		//mailDao.getSession().close();
	}
	public void update(Mail mail){
		mailDao.update(mail);
		mailDao.getSession().close();
	}
	public void delete(String id){
		mailDao.del(id);
		//mailDao.getSession().close();
	}
	public List<Mail> find(String contactsid){
		return mailDao.findBy("contactsid", contactsid);
	}
	@Autowired
	public void setMailDao(MailDao mailDao) {
		this.mailDao = mailDao;
	}
	
}
